/*
 *  Copyright 2019-2020 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.wteam.dragon.system.apps.generator.pojo.bean;

import com.baomidou.mybatisplus.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * @Author 陈晓辉
 * @Date 2021/5/29 8:43
 */

@Data
@Table
@TableName
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class GenConfig extends BaseBean {
    @IsKey
    @IsNotNull
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @Column(comment = "表名")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String tableName;

    @Column(comment = "接口名称")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String apiAlias;

    @IsNotNull
    @Column(comment = "包路径")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String pack;

    @Column(comment = "模块名")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String moduleName;

    @Column(comment = "作者")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String author;

    @Column(comment = "表前缀")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String prefix;

    @Column(comment = "是否覆盖")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Boolean cover;

    public GenConfig(String tableName) {
        this.tableName = tableName;
    }
}
